#include "CAbacus.h"

CAbacus::CAbacus(): m_digit(7)
{
    unsigned int i;
    m_lpComponents = new unsigned int[m_digit];
    for (i = 0; i < m_digit; ++i)
    {
        m_lpComponents[i] = 0;
    }
    //ctor
}

CAbacus::~CAbacus()
{
    delete[]m_lpComponents;
}

void CAbacus::data_clear()
{
    unsigned int i;
    for(i = 0; i < m_digit; ++i)
    {
        m_lpComponents[i] = 0;
    }
}

void CAbacus::move_right(unsigned int last_digit)
{
    unsigned int i;
    for (i = 0; i < m_digit - 1; ++i)
    {
        m_lpComponents[i] = m_lpComponents[i + 1];
    }
    m_lpComponents[i] = last_digit;

}
